package com.bestdreamer.thread_safe;

public class MyObject4 {
    // 内部类方式
    private static class MyObjectHandler{
        private static MyObject4 myObject4 = new MyObject4();
    }

    private MyObject4(){}

    public static MyObject4 getInstance(){
        return MyObjectHandler.myObject4;
    }
}
